#include <iostream>
#include <thread>

using std::cout;
using std::endl;
using std::thread;

int main(int argc, char *argv[])
{
    /* [](){ cout << "hello" << endl; }(); */
    /* [](int x){ cout << "hello" << endl; }(3); */
    cout << "main thread id = " << std::this_thread::get_id() << endl;
    thread th([](int x, int y, int z){
        cout << "void threadFunc(int )" << endl;
        cout << "x = " << x << endl;
        cout << "y = " << y << endl;
        cout << "z = " << z << endl;
        cout << "child thread id = " << std::this_thread::get_id() << endl;

              }, 5, 55, 555);

    th.join();//让线程等待子线程的退出
    return 0;
}

